//
//  SHLabelCell.m
//  NEWHYSJ
//
//  Created by SH_iOS on 2017/5/9.
//  Copyright © 2017年 SH. All rights reserved.
//

#import "SHLabelCell.h"

@interface SHLabelCell ()


@end

@implementation SHLabelCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self configUI];
        
    }
    return self;
    
}

- (void)configUI{
    
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.font = KSHSystemFont(15);
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(__I6Width(15));
        make.top.equalTo(self.mas_top).with.offset(__I6Height(12));
        make.height.mas_equalTo(__I6Height(20));
    }];
    
    self.contentLabel = [[UILabel alloc]init];
    self.contentLabel.font = KSHSystemFont(15);
    self.contentLabel.textAlignment  = NSTextAlignmentRight;
    self.contentLabel.textColor =  [UIColor colorWithWhite:208.f/255.f alpha:1];
    [self.contentView addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).with.offset(__I6Height(12));
        make.right.equalTo(self.mas_right).with.offset(__I6Width(-40));
        make.left.equalTo(self.nameLabel.mas_right).with.offset(__I6Width(5));
        make.height.mas_equalTo(__I6Height(20));
    }];
   
    UIView *line  = [[UIView alloc]init];
    line.backgroundColor  = KLINECOLOR;
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(__I6Width(15));
        make.bottom.equalTo(self.mas_bottom);
        make.width.mas_equalTo(KScreenWidth);
        make.height.mas_equalTo(0.5);
    }];
    UIImageView *arrow1 = [[UIImageView alloc]init];
    arrow1.image = [UIImage imageNamed:@"jmarrow@2x.png"];
    [self addSubview:arrow1];
    [arrow1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).with.offset(__I6Height(15));
        make.right.equalTo(self.mas_right).with.offset(__I6Width(-15));
        make.height.mas_equalTo(__I6Height(14));
        make.width.mas_equalTo(__I6Width(7.5));
    }];
   
    
}

-(void)setLabelText:(NSString *)labelText{
    
    CGFloat labelW  = 120;
    [self.nameLabel mas_updateConstraints:^(MASConstraintMaker *make){
        make.left.equalTo(self.mas_left).with.offset(__I6Width(15));
        make.top.equalTo(self.mas_top).with.offset(__I6Height(11));
        make.width.mas_equalTo(labelW);
        make.height.mas_equalTo(__I6Height(20));
        
    }];
    self.nameLabel.text = labelText;
    
    
    
}
- (void)setPlaceholder:(NSString *)placeholder{
    self.contentLabel.text  = placeholder;
}

- (void)contentLabelText:(NSString *)text{
    self.contentLabel.text  = text;
    self.contentLabel.textColor = [UIColor blackColor];
}



@end
